.class public Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;
.super Ljava/lang/Object;
.source "SprayerUsingPolyline.java"

# interfaces
.implements Llt/noframe/gpsfarmguide/sprayer/spray/TrackSprayerInterface;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Llt/noframe/gpsfarmguide/sprayer/spray/TrackSprayerInterface<",
        "Lcom/google/android/gms/maps/model/Polyline;",
        ">;"
    }
.end annotation


# static fields
.field private static bearingTolerance:D = 0.05


# instance fields
.field private area:D

.field private bearing:D

.field private color:I

.field private color2:I

.field private cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

.field private currentArea:D

.field currentPoly:Lcom/google/android/gms/maps/model/Polyline;

.field currentPolyCords:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;"
        }
    .end annotation
.end field

.field private drawPolygon:Z

.field private lastZoom:D

.field private lastbearing:D

.field private polylines:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/Polyline;",
            ">;"
        }
    .end annotation
.end field

.field private sprayWidth:D


# direct methods
.method public constructor <init>(D)V
    .locals 2

    .line 48
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    const/4 v0, 0x0

    .line 22
    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPoly:Lcom/google/android/gms/maps/model/Polyline;

    .line 23
    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    const-wide/high16 v0, 0x4014000000000000L    # 5.0

    .line 27
    iput-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    const v0, -0x4eff0100

    .line 33
    iput v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->color:I

    const v0, -0x4ef00100

    .line 34
    iput v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->color2:I

    const/4 v0, 0x1

    .line 43
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->drawPolygon:Z

    .line 49
    new-instance v0, Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    invoke-direct {v0}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;-><init>()V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    const-wide/16 v0, 0x0

    .line 50
    iput-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->area:D

    .line 51
    iput-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentArea:D

    .line 52
    iput-wide p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    const-wide/high16 p1, -0x4010000000000000L    # -1.0

    .line 53
    iput-wide p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->lastZoom:D

    return-void
.end method

.method private getDifference(DD)D
    .locals 7

    sub-double v0, p1, p3

    const-wide v2, 0x4076800000000000L    # 360.0

    const-wide/16 v4, 0x0

    cmpg-double v6, v0, v4

    if-gez v6, :cond_0

    add-double/2addr v0, v2

    :cond_0
    sub-double/2addr p3, p1

    cmpg-double p1, p3, v4

    if-gez p1, :cond_1

    add-double/2addr p3, v2

    .line 187
    :cond_1
    invoke-static {v0, v1, p3, p4}, Ljava/lang/Math;->min(DD)D

    move-result-wide p1

    return-wide p1
.end method


# virtual methods
.method public deleteSprayed()V
    .locals 2

    .line 67
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/Polyline;

    .line 68
    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->remove()V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public getArea()D
    .locals 2

    .line 192
    iget-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->area:D

    return-wide v0
.end method

.method public onCameraMove()V
    .locals 13

    .line 157
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-lez v0, :cond_1

    .line 159
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    const/4 v2, 0x1

    sub-int/2addr v1, v2

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v0

    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v3

    sub-int/2addr v3, v2

    invoke-interface {v1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    sub-int/2addr v1, v2

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/model/LatLng;

    .line 161
    iget-wide v3, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    double-to-float v1, v3

    .line 162
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v3

    invoke-virtual {v3}, Lcom/google/android/gms/maps/GoogleMap;->getProjection()Lcom/google/android/gms/maps/Projection;

    move-result-object v3

    .line 163
    invoke-virtual {v3, v0}, Lcom/google/android/gms/maps/Projection;->toScreenLocation(Lcom/google/android/gms/maps/model/LatLng;)Landroid/graphics/Point;

    move-result-object v4

    .line 164
    new-instance v5, Landroid/graphics/Point;

    iget v6, v4, Landroid/graphics/Point;->x:I

    add-int/lit16 v6, v6, 0x12c

    iget v4, v4, Landroid/graphics/Point;->y:I

    invoke-direct {v5, v6, v4}, Landroid/graphics/Point;-><init>(II)V

    invoke-virtual {v3, v5}, Lcom/google/android/gms/maps/Projection;->fromScreenLocation(Landroid/graphics/Point;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v3

    .line 165
    new-array v2, v2, [F

    if-eqz v0, :cond_1

    if-eqz v3, :cond_1

    .line 167
    iget-wide v4, v0, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v6, v0, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    iget-wide v8, v3, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v10, v3, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    move-object v12, v2

    invoke-static/range {v4 .. v12}, Landroid/location/Location;->distanceBetween(DDDD[F)V

    const/4 v0, 0x0

    .line 168
    aget v0, v2, v0

    const/high16 v2, 0x43960000    # 300.0f

    div-float/2addr v0, v2

    div-float/2addr v1, v0

    .line 170
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/Polyline;

    .line 171
    invoke-virtual {v2}, Lcom/google/android/gms/maps/model/Polyline;->getWidth()F

    move-result v3

    cmpl-float v3, v3, v1

    if-eqz v3, :cond_0

    .line 172
    invoke-virtual {v2, v1}, Lcom/google/android/gms/maps/model/Polyline;->setWidth(F)V

    goto :goto_0

    :cond_1
    return-void
.end method

.method public pauseSpraying()V
    .locals 1

    const/4 v0, 0x0

    .line 182
    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPoly:Lcom/google/android/gms/maps/model/Polyline;

    .line 183
    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    return-void
.end method

.method public reset()V
    .locals 2

    .line 59
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->deleteSprayed()V

    const-wide/16 v0, 0x0

    .line 60
    iput-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->area:D

    .line 61
    iput-wide v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentArea:D

    return-void
.end method

.method public setIsDraw(Z)V
    .locals 0

    .line 217
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->drawPolygon:Z

    return-void
.end method

.method public setPolys(Ljava/util/List;D)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/Polyline;",
            ">;D)V"
        }
    .end annotation

    .line 197
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->drawPolygon:Z

    if-eqz v0, :cond_0

    .line 198
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    goto :goto_1

    .line 200
    :cond_0
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/model/Polyline;

    .line 201
    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/Polyline;->remove()V

    goto :goto_0

    .line 204
    :cond_1
    :goto_1
    iput-wide p2, p0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->area:D

    return-void
.end method

.method public sprayPoint(Lcom/google/android/gms/maps/model/LatLng;)V
    .locals 21

    move-object/from16 v0, p0

    move-object/from16 v9, p1

    .line 81
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    const/4 v2, 0x0

    const/4 v3, 0x1

    if-nez v1, :cond_2

    .line 82
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iput-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    .line 84
    iget-boolean v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->drawPolygon:Z

    if-eqz v1, :cond_1

    const/high16 v1, 0x40400000    # 3.0f

    .line 86
    iget-wide v4, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    double-to-float v4, v4

    .line 87
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v5

    invoke-virtual {v5}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v5

    invoke-virtual {v5}, Lcom/google/android/gms/maps/GoogleMap;->getProjection()Lcom/google/android/gms/maps/Projection;

    move-result-object v5

    .line 88
    invoke-virtual {v5, v9}, Lcom/google/android/gms/maps/Projection;->toScreenLocation(Lcom/google/android/gms/maps/model/LatLng;)Landroid/graphics/Point;

    move-result-object v6

    .line 89
    new-instance v7, Landroid/graphics/Point;

    iget v8, v6, Landroid/graphics/Point;->x:I

    add-int/lit16 v8, v8, 0x3e8

    iget v6, v6, Landroid/graphics/Point;->y:I

    invoke-direct {v7, v8, v6}, Landroid/graphics/Point;-><init>(II)V

    invoke-virtual {v5, v7}, Lcom/google/android/gms/maps/Projection;->fromScreenLocation(Landroid/graphics/Point;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v5

    .line 90
    new-array v6, v3, [F

    if-eqz v9, :cond_0

    if-eqz v5, :cond_0

    .line 92
    iget-wide v10, v9, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v12, v9, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    iget-wide v14, v5, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v7, v5, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    move-wide/from16 v16, v7

    move-object/from16 v18, v6

    invoke-static/range {v10 .. v18}, Landroid/location/Location;->distanceBetween(DDDD[F)V

    .line 93
    aget v1, v6, v2

    const/high16 v2, 0x447a0000    # 1000.0f

    div-float/2addr v1, v2

    div-float v1, v4, v1

    .line 97
    :cond_0
    new-instance v2, Lcom/google/android/gms/maps/model/PolylineOptions;

    invoke-direct {v2}, Lcom/google/android/gms/maps/model/PolylineOptions;-><init>()V

    invoke-virtual {v2, v9}, Lcom/google/android/gms/maps/model/PolylineOptions;->add(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/PolylineOptions;

    iget v4, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->color:I

    invoke-virtual {v2, v4}, Lcom/google/android/gms/maps/model/PolylineOptions;->color(I)Lcom/google/android/gms/maps/model/PolylineOptions;

    const/4 v4, 0x2

    invoke-virtual {v2, v4}, Lcom/google/android/gms/maps/model/PolylineOptions;->jointType(I)Lcom/google/android/gms/maps/model/PolylineOptions;

    invoke-virtual {v2, v3}, Lcom/google/android/gms/maps/model/PolylineOptions;->geodesic(Z)Lcom/google/android/gms/maps/model/PolylineOptions;

    invoke-virtual {v2, v1}, Lcom/google/android/gms/maps/model/PolylineOptions;->width(F)Lcom/google/android/gms/maps/model/PolylineOptions;

    .line 99
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v1

    invoke-virtual {v1, v2}, Lcom/google/android/gms/maps/GoogleMap;->addPolyline(Lcom/google/android/gms/maps/model/PolylineOptions;)Lcom/google/android/gms/maps/model/Polyline;

    move-result-object v1

    iput-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPoly:Lcom/google/android/gms/maps/model/Polyline;

    .line 100
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->polylines:Ljava/util/List;

    iget-object v2, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPoly:Lcom/google/android/gms/maps/model/Polyline;

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 102
    :cond_1
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    invoke-interface {v1, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto/16 :goto_0

    .line 108
    :cond_2
    iget-object v4, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v5

    sub-int/2addr v5, v3

    invoke-interface {v1, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {v4, v1, v9}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->lineSegmentBearing(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v4

    iput-wide v4, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    .line 112
    iget-wide v4, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    iget-wide v6, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->lastbearing:D

    invoke-direct {v0, v4, v5, v6, v7}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->getDifference(DD)D

    move-result-wide v4

    invoke-static {v4, v5}, Ljava/lang/Math;->abs(D)D

    move-result-wide v4

    sget-wide v6, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearingTolerance:D

    cmpg-double v1, v4, v6

    if-gez v1, :cond_3

    const/4 v2, 0x1

    :cond_3
    if-eqz v2, :cond_4

    .line 115
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v2

    sub-int/2addr v2, v3

    invoke-interface {v1, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    .line 118
    :cond_4
    new-instance v10, Ljava/util/ArrayList;

    invoke-direct {v10}, Ljava/util/ArrayList;-><init>()V

    .line 119
    iget-object v11, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v2

    sub-int/2addr v2, v3

    invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    move-object v12, v1

    check-cast v12, Lcom/google/android/gms/maps/model/LatLng;

    iget-wide v13, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    iget-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    const-wide/high16 v19, 0x4000000000000000L    # 2.0

    div-double v15, v1, v19

    const-wide v17, 0x4056800000000000L    # 90.0

    invoke-virtual/range {v11 .. v18}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistance(Lcom/google/android/gms/maps/model/LatLng;DDD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-interface {v10, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 120
    iget-object v11, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v2

    sub-int/2addr v2, v3

    invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    move-object v12, v1

    check-cast v12, Lcom/google/android/gms/maps/model/LatLng;

    iget-wide v13, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    iget-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    div-double v15, v1, v19

    const-wide v17, -0x3fa9800000000000L    # -90.0

    invoke-virtual/range {v11 .. v18}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistance(Lcom/google/android/gms/maps/model/LatLng;DDD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-interface {v10, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 122
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    iget-wide v3, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    iget-wide v5, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    div-double v5, v5, v19

    const-wide v7, -0x3fa9800000000000L    # -90.0

    move-object/from16 v2, p1

    invoke-virtual/range {v1 .. v8}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistance(Lcom/google/android/gms/maps/model/LatLng;DDD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-interface {v10, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 123
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->cu:Llt/noframe/gpsfarmguide/sprayer/CCalcs;

    iget-wide v3, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    iget-wide v5, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->sprayWidth:D

    div-double v5, v5, v19

    const-wide v7, 0x4056800000000000L    # 90.0

    invoke-virtual/range {v1 .. v8}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistance(Lcom/google/android/gms/maps/model/LatLng;DDD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-interface {v10, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 125
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    invoke-interface {v1, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 127
    iget-boolean v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->drawPolygon:Z

    if-eqz v1, :cond_5

    .line 128
    iget-object v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPoly:Lcom/google/android/gms/maps/model/Polyline;

    iget-object v2, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentPolyCords:Ljava/util/List;

    invoke-virtual {v1, v2}, Lcom/google/android/gms/maps/model/Polyline;->setPoints(Ljava/util/List;)V

    .line 131
    :cond_5
    invoke-static {v10}, Llt/noframe/gpsfarmguide/utils/Mathematics;->calculateArea(Ljava/util/List;)D

    move-result-wide v1

    iput-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentArea:D

    .line 149
    :goto_0
    iget-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->bearing:D

    iput-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->lastbearing:D

    .line 150
    iget-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->area:D

    iget-wide v3, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->currentArea:D

    add-double/2addr v1, v3

    iput-wide v1, v0, Llt/noframe/gpsfarmguide/sprayer/spray/SprayerUsingPolyline;->area:D

    return-void
.end method
